/*
 * @Author: c
 * @Date: 2023-11-24 08:51:46
 * @LastEditTime: 2024-01-14 18:36:14
 * @LastEditors: c
 * @Description: 
 * @FilePath: \music-web-backend\src\main.ts
 * https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { NestExpressApplication } from '@nestjs/platform-express';
import { AppModule } from './app.module';


async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);
  app.setGlobalPrefix("api/v1");
  app.useGlobalPipes(new ValidationPipe({
    whitelist: true, //去除在类上不存在的字段
    enableDebugMessages: true
  }))

  // app.useGlobalFilters(new HttpExceptionFilter()); //不能注入依赖，因为它们不属于任何模块
  await app.listen(8000);
}
bootstrap();
